#if !defined(AFX_KUSERLIST_H__3CE2C935_D68A_413A_A82E_175AD74DB1DF__INCLUDED_)
#define AFX_KUSERLIST_H__3CE2C935_D68A_413A_A82E_175AD74DB1DF__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// KUserList.h : header file
//
#include "resource.h"
#include "DialogResize.h"
#include "KAddUser.h"
#include "KSFileDialog.h"
#include "KDcom.h"
#include "KAddSysUser.h"
#include "UserPages.h"

/////////////////////////////////////////////////////////////////////////////
// KUserMain dialog
extern KDcom theDcom;

/////////////////////////////////////////////////////////////////////////////
// KUserList dialog
class KUserList : public CDialogResize
{
// Construction
public:
	void ShowUsers();
	void SetPinCode4User(const CString &strSn);
	void EnableSetPinCodeFunc();
	int AddToUserGroupList();
	BOOL SetCurUserGroup(const CString &strUserGroup);
	void OnSelchangeUserlist();
	KUserList(CWnd* pParent = NULL);   // standard constructor
	
	CUserPages *m_puserpages;
// Dialog Data
	//{{AFX_DATA(KUserList)
	enum { IDD = IDD_USER_LIST };
	CEdit	m_cedtSearchText;
	CEdit	m_cedtUserPageNo;
	CStatic	m_cstcUserPagesCnt;
	CButton	m_cbtnSetPinCode;
	CComboBox	m_cSearchMode;
	KReportCtrl	m_UserList;
	KReportCtrl	m_clstUserGroup;
	CString		m_strSearchText;
	CString     m_curUser;
	//}}AFX_DATA


// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(KUserList)
	public:
	virtual BOOL PreTranslateMessage(MSG* pMsg);
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:
	CImageList m_ImageList;
	CString m_ImportFile;

	// Generated message map functions
	//{{AFX_MSG(KUserList)
	virtual void OnOK();
	virtual void OnCancel();
	virtual BOOL OnInitDialog();
	afx_msg void OnBtnAddUserGroup();
	afx_msg void OnKeydownListUsers(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnButtonAddUser();
	afx_msg void OnButtonEditUser();
	afx_msg void OnButtonDelUser();
	afx_msg void OnBtnDeleteUserGroup();
	afx_msg void OnBtnEditUserGroup();
	afx_msg void OnDblclkListUserGroup(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnDblclkListUsers(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnItemchangedListUserGroups(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnChangeEditFind();
	afx_msg void OnButtonFind();
	afx_msg void OnBtnExport();
	afx_msg void OnBtnImportUsers();
	afx_msg void OnBtnSetPinCode();
	afx_msg void OnItemchangedListUsers(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnSize(UINT nType, int cx, int cy);
	afx_msg void OnBtnImport();
	afx_msg void OnBtnGoFirstUserPage();
	afx_msg void OnBtnPrevUserPage();
	afx_msg void OnBtnNextUserPage();
	afx_msg void OnBtnLastUserPage();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
	DECLARE_DLGRESIZE_MAP;

private:
	void ShowFilter();
	void SetPageSize();
	CArray<CUserPages, CUserPages&> m_arrupsUserPages;
};

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_KUSERLIST_H__3CE2C935_D68A_413A_A82E_175AD74DB1DF__INCLUDED_)
